<include file="../Public/header_sh.html" />

<script type="text/javascript">
//鼠标移动表格效果
$(document).ready(function(){
    $("tr[overstyle='on']").hover(
      function () {
        $(this).addClass("bg_hover");
      },
      function () {
        $(this).removeClass("bg_hover");
      }
    );
});

function checkon(o){
    if( o.checked == true ){
        $(o).parents('tr').addClass('bg_on') ;
    }else{
        $(o).parents('tr').removeClass('bg_on') ;
    }
}

function checkAll(o){
    if( o.checked == true ){
        $('input[name="checkbox"]').attr('checked','true');
        $('tr[overstyle="on"]').addClass("bg_on");
    }else{
        $('input[name="checkbox"]').removeAttr('checked');
        $('tr[overstyle="on"]').removeClass("bg_on");
    }
}

//获取已选择用户的ID数组
function getChecked() {
    var gids = new Array();
    $.each($('input:checked'), function(i, n){
        gids.push( $(n).val() );
    });
    return gids;
}
/**查询数据分页**/
function goPage(pno){
	$("#search_div").find('#pno').val(pno);
	$("#search_div").find('#searchForm').submit();
}
</script>

    <!--  START CONTENT WRAPPER -->
    <div id="content_wrapper">
	
      <!--  START PRIMARY CONTENT style="position: relative;"-->
      <div id="primary_content">

        <h2>商品列表</h2>
        <div class="clear"></div>
       	<!-------- 搜索开始 -------->
		  	<div id="search_div" style="padding: 10px 0;text-align:center;">
				<div class="sform">
					<form method="post" action="{:U('shanghu://Goods/index')}" id="searchForm">
						<input id="pno" name="pno" type="hidden" value="1">
					    <dl>
					    	
					      <span>商品分类：</span>
					      
						    	<input id="sortdesc" type="text" value="{$sort_id|getCategoryName}"  class="normal_input"
					      					onclick="ui.box.load(
					    											'{:U('Index://Public/showtree',array('code'=>'goods'))}'
					    											,{ title:'查看商品分类' })"
					      					readonly>
					      	<input id="sort_id" name="sort_id" type="hidden" value="{$sort_id}">
									<script>
										function _tmp_setselectdict(rel,txt){
									    		$('#sortdesc').val(txt);
									    		$('#sort_id').val(rel);
									    }
									</script>
							<span>&nbsp;&nbsp;&nbsp;</span>
							<span>排序：</span>
					      	<input name="order" type="radio" value="new" <eq name="order" value="new">checked</eq>>最新&nbsp;
					        <input name="order" type="radio" value="up" <eq name="order" value="up">checked</eq>>销售量升&nbsp;
					        <input name="order" type="radio" value="down" <eq name="order" value="down">checked</eq>>销售量降&nbsp;
					    	<span>&nbsp;&nbsp;&nbsp;</span>
					    	<input type="submit" class="btn_b" value="查询" />
					    </dl>
					</form>
			  	</div>
		  	</div>
		  	<!-------- 搜索结束 -------->

  
  			<div class="list">
  				<table id="goods_list" width="100%" border="0" cellspacing="0" cellpadding="0">
  					<tr>
				    	<th>ID</th>
				    	<th class="line_l">名称</th>
				    	<th class="line_l" style="text-align:right">分类</th>
				    	<th class="line_l" style="text-align:right">销售量</th>
				    	<th class="line_l" style="text-align:center">开始时间</th>
				    	<th class="line_l" style="text-align:center">操作</th>
				  	</tr>
				  	<php>$html_page = $pagedata['pagenavhtml'];unset($pagedata['pagenavhtml']);</php>
  					<volist id="vo" name="pagedata">
				    	<tr overstyle='on' id="goods_{$vo.goods_id}">
				        	<td>{$vo.goods_id}</td>
				        
				        	<td>
				        		<div style="float: left; margin-right: 10px; border: 1px solid rgb(128, 152, 168); height: 30px; padding: 1px; width: 30px;">
											<img width="30" height="30" src="{:getAttachUrl($vo['goods_icon'])}">
										</div>
										<div style="float: left;padding-top: 4px;">
											<a href="{:U('shanghu://Goods/gdetail',array('gid'=>$vo['goods_id']))}" id="goods_title_{$vo.goods_id}">{$vo.goods_title}</a>
										</div>
							</td>
				        
				        	<td><div style="float:right">
				
				        		<a href="{:U('shanghu://Goods/index',array('sort_id'=>$vo['goods_sort_id']))}">{$vo['goods_sort_id']|getCategoryName}</a></div></td>

				        	<td style="text-align:right">
					        	<span><php>echo empty($vo['sum'])?0:$vo['sum'];</php></span>
				        	</td>
				        	<td style="text-align:center">{:paramMillisecond2Date($vo['goods_start_time'],'Y-m-d')}</td>
				
				        	<td style="text-align:center">
								<a href="{:U('shanghu://Statis/index',array('statmodel'=>'goods','gid'=>$vo['goods_id']))}" title="查看商品销售统计">
									<img width="20" height="20" style="vertical-align: middle;" src="/Public/shanghu/images/chart_32.png" alt="Stats" class="png_bg">
								</a>
				        	</td>
				      </tr>
				  	</volist>
  				</table>
  			</div>
  			<php>if(empty($pagedata)){</php>
				<php>$alert_message="无相关商品！";</php>
				<include file="../Public/alert_box.html" />
  			<php>}</php>
		  	<div style="padding: 20px 0;text-align:center;">
		    	<div class="page_box">{$html_page}</div>
		  	</div>
    	<!-- Paginator end -->
      </div>
      <!--  END PRIMARY CONTENT -->
 	  <!--  START SIDEBAR -->
      <div id="sidebar">
        <h3>常用操作</h3>
       	<include file="../shanghu/Tpl/default/Public/quickoptlist.html" />
        
      </div><!--  end div #sidebar -->
      <!--  END SIDEBAR -->
    </div><!--  end div #content_wrapper -->
<!--  END CONTENT_WRAPPER -->

<include file="../Public/footer_sh.html" />